Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow unsetting boolean configs #358

Merged
merged 3 commits into from
Nov 11, 2022
Merged

Conversation

zcsahok
Copy link
Member

@zcsahok zcsahok commented Oct 26, 2022

See #357.
Minor extension: on/off are also treated as true/false.

Man page update will follow when code is OK. (will have to update a lot of params...)

@zcsahok
Copy link
Member Author

zcsahok commented Nov 7, 2022

Updated man page. Also added some non-documented parameters.

@VictorDenisov would it be OK to rename NO_LEADING_ZEROS_SERIAL to LEADING_ZEROS_SERIAL with true default value?

@zcsahok zcsahok linked an issue Nov 7, 2022 that may be closed by this pull request
@VictorDenisov
Copy link
Contributor

Yeah. Totally. I guess now the configuration will look like
LEADING_ZEROS_SERIAL off
?

@zcsahok
Copy link
Member Author

zcsahok commented Nov 8, 2022

Yes. Any of these statements will suppress leading zeros.

LEADING_ZEROS_SERIAL=off
LEADING_ZEROS_SERIAL=NO
LEADING_ZEROS_SERIAL=False

(the argument is case-insensitive, so no does the same thing too)

@dl1jbe
Copy link
Member

dl1jbe commented Nov 9, 2022

Code looks good and should catch all needed use cases. I think we should merge it in.

To drop keywords with negative logic (e.g. NO_BANDSWITCH_ARROWKEYS) it seems we need to document the default value of the boolean values in the man page.

It seems further desirable to have a command to show the state of the boolean controls in the running program.

But both may be later additions.

@zcsahok
Copy link
Member Author

zcsahok commented Nov 9, 2022

I'd keep legacy negative logic parameters. It would be more work to document such a change than the actual benefit. But at least for new configs we shall stick to positive logic.

Showing (and editing + reloading) configs is related to #233: one idea could be to move all globals and their initialization out of main into a data.c (like for the tests). But this is also more for the future.

@dl1jbe
Copy link
Member

dl1jbe commented Nov 10, 2022

I'd keep legacy negative logic parameters. It would be more work to document such a change than the actual benefit. But at least for new configs we shall stick to positive logic.

Showing (and editing + reloading) configs is related to #233: one idea could be to move all globals and their initialization out of main into a data.c (like for the tests). But this is also more for the future.

I agree to both. They are ideas for the long run.

@zcsahok zcsahok merged commit fc4b0f0 into Tlf:master Nov 11, 2022
@zcsahok zcsahok mentioned this pull request Nov 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make boolean configs symmetric
3 participants